package net.oschina.app.hjp1;


import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by Administrator on 2017/7/13 0013.
 */

public abstract class NetBase<T>   {


    public Callback<T> mCallback = new Callback<T>() {
        @Override
        public void onResponse(Call<T> call, Response<T> response) {

            getSuccessData(response);
        }

        @Override
        public void onFailure(Call<T> call, Throwable t) {
            t.printStackTrace();
            getFailureData(t);
        }
    };

    protected abstract void getFailureData(Throwable t);

    protected abstract void getSuccessData(Response<T> response);



}
